//
//  NSObject+XML.m
//  CreditAddressBook
//
//  Created by LE on 15/12/29.
//  Copyright © 2015年 Lee. All rights reserved.
//

#import "NSObject+XML.h"
#import "MJExtension.h"
#import "XMLDictionary.h"

@implementation NSObject (XML)

+ (instancetype)objectWithXMLFilename:(NSString *)filename {
    NSAssert(filename, @"filename参数为nil");
    NSDictionary *xmlfile = [NSDictionary dictionaryWithXMLFile:[[NSBundle mainBundle] pathForResource:filename ofType:nil]];
    return [self objectWithKeyValues:xmlfile];
}
+ (instancetype)objectWithXMLDataname:(NSData *)data{
     NSDictionary *xmlfile = [NSDictionary dictionaryWithXMLData:data];
     return [self objectWithKeyValues:xmlfile];
}

   @end
